# 生成一个矩阵
import numpy as np

randMat=np.mat(np.random.rand(4,4))
'''
matrix([[0.44046581, 0.78316323, 0.17116199, 0.24213341],
        [0.19928318, 0.8270339 , 0.51489053, 0.44271013],
        [0.65975116, 0.87386699, 0.06581744, 0.70324462],
        [0.78425048, 0.61136823, 0.39839062, 0.46827545]])
'''

# 矩阵求逆
invRandMat=randMat.I
'''
matrix([[ 0.7105134 , -1.40558988, -0.41142504,  1.57933179],
        [ 2.02386646,  0.20590043, -0.07894666, -1.12258947],
        [-0.8594876 ,  1.3503037 , -1.47120243,  1.3772508 ],
        [-3.10103028,  0.93642585,  2.0437523 , -0.21559955]])
'''

